using CHARACTERS;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

namespace TEST
{
    public class Test_Audio : MonoBehaviour
    {
        // Start is called before the first frame update
        void Start()
        {
            StartCoroutine(Running());
        }

        Character CreateCharacter(string name) => CharacterManager.instance.CreateCharacter(name);
        IEnumerator Running()
        {
            yield return new WaitForSeconds(3);

            SpritCharacter raelin = CreateCharacter("Raelin") as SpritCharacter;
            raelin.Show();
            
            yield return new WaitForSeconds(1);
            yield return raelin.Say("Can we see your ship?");
            AudioManager.instance.PlayTrack("Audio/Ambience/RainyMood", 0);
            AudioManager.instance.PlayTrack("Audio/Music/Upbeat", 1, pitch: 0.7f);

            yield return raelin.Say("we can have mutiple channels for playing ambience as well as music!");
            AudioManager.instance.StopTrack(1);
        }
    }
}